#pragma once

#include "container.h"
#include <iostream>
#include <cmath>
#include <string>

using std::istream;
using std::ostream;
using std::string;

struct big_int
{
	public :
		big_int();
		big_int(int64);
		big_int(string);

		void swap(big_int&);

		bool operator<(const big_int&) const;

		big_int& operator +=(const big_int&);
		big_int& operator -=(const big_int&);
		big_int& operator *=(const big_int&);
		big_int& operator /=(big_int);
		big_int& operator %=(const big_int&);
		
		big_int& operator =(const big_int&);

		big_int operator << (const int) const;
		big_int operator >> (const int) const;
	private :
		container number;
		int length;
		bool sign;// 0 - "+", 1 - "-"

		const static long long base = 100000;
		//const static long long base = 10;
		const static int base_length = 5;
		//const static int base_length = 1;
		big_int(const container&, bool);

		friend void swap(big_int& a, big_int& b);
		friend big_int abs(big_int);
		friend big_int operator-(big_int);
		friend void repair(big_int&);
		friend istream& operator>>(istream&, big_int&);
		friend ostream& operator<<(ostream&, const big_int&);
};

bool operator!=(const big_int&, const big_int&);
bool operator<=(const big_int&, const big_int&);
bool operator>=(const big_int&, const big_int&);
bool operator>(const big_int&, const big_int&);
bool operator==(const big_int&, const big_int&);

big_int operator+(big_int, const big_int&);
big_int operator-(big_int, const big_int&);
big_int operator*(big_int, const big_int&);
big_int operator/(big_int, const big_int&);
big_int operator%(big_int, const big_int&);
